<link rel="stylesheet" type="text/css" href="<?php echo PUBLIC_URL ?>css/content.css"><!-- 首页内容区域大盒子-->
<link rel="stylesheet" type="text/css" href="<?php echo PUBLIC_URL ?>css/with.css">
<script src="<?php echo PUBLIC_URL ?>js/jquery-1.8.3.js"></script>
<link rel="stylesheet" href="<?php echo PUBLIC_URL ; ?>kindeditor/themes/default/default.css" />
		<script charset="utf-8" src="<?php echo PUBLIC_URL ; ?>kindeditor/kindeditor-min.js"></script>
		<script charset="utf-8" src="<?php echo PUBLIC_URL ; ?>kindeditor/lang/zh_CN.js"></script>
		<script>
			KindEditor.ready(function(K) {
				K.create('textarea[name="content"]', {
					filterMode : false
				});
			});
		</script>
<style>
#footer{margin-top:10px;}
#content-tow .right{height:1500px; background:#FFFFFF;}
</style>
<script src="<?php echo PUBLIC_URL ?>js/jquery-1.8.3.js" type="text/javascript" charset="utf-8"></script>
<?php date_default_timezone_set('PRC'); ?>
<div class="n" style="height:35px;"></div><!--放个div，才能让龙播图在ff中动作-->
<div class="nav" style="height:40px; margin-top:20px; text-align:left;">
            <i style="margin-left:20px; height:40px; line-height:40px;"> 当前位置：<i style="color:green">首页 > <?php echo $_GET['classdir'];?> ></i> 药物依从性：控血糖关键</i>
    </div>
<div id="content" style="background:#FFFFFF; height:2220px;">
   
        <div id="content-tow" style="background:#FFFFFF;"><!-- 包括左右两个盒子start-->
                <!-- 便利区左盒子 -->
            <!--<div id="articleContent" style="position:relative;">-->
                    <div class="left1" style="width:68%;float:left;">
                            <h3 style="font-size:30px;"><?php echo $articleInfo['article']['artileTitle'] ?></h3>
                            <div style="width:300px; position:relative;left:430px; ">
                                    <img class="imgl"  src="<?php echo PUBLIC_URL ?>images/ao/time.bmp" >
                                    <font style="color:gray;font-size:14px;top:-5px;position:relative;"><?php echo date("Y-m-d H:i:s", time()); ?></font>
                                    <img class="imgk" style="" src="<?php echo PUBLIC_URL ?>images/ao/name.bmp" >
                                    <font style="color:green;font-size:14px;;top:-5px;position:relative;"><?php echo $articleInfo['article']['author'] ?></font>
                            </div>
                            <div style="width:100%;margin-bottom:10px;"></div>
                             <div style="color:#AAB1B7;font-size:12px; float:right;word-break:break-all; text-indent:2em;line-height:30px; margin-left:10px; border-top:1px dashed #D7D4CF; padding-top:20px;">
                                                    <div class="tuu" style="position:relative; width:400px;border:1px solid #D7D4CF; height:330px;left:10px; display:inline-block;float:left;margin-right:20px;margin-bottom:20px;text-align:center; background:#FFFFFF;">
                                                          <img style="border:0px; position:relative; left:-18px; top:5px;" width="97%" height="97%" src="<?php echo $articleInfo['article']['img'] ?>" />
                                                    </div>

                                                    <?php echo $articleInfo['article']['articleContent'] ?>
                            </div>
                           
                  
                   
                                <div style="border-bottom:1px solid #F5F4F3;width:68%;float:left;margin-top:50px;background:#FFFFFF;">
                                              
                                                      <img style=" float:left;position:absolute;left:1px;" src="<?php echo PUBLIC_URL ; ?>images/ao/public.bmp" />
                                                      <font style="color:#B2B2B2;position:absolute;left:60px; "> |  共有1000000人浏览</font>
                                                      <div class="may" style="color:#000000;margin-top:80px;margin-left:-670px;">
                                                        <h3 style="font-size:17px;position:absolute;left:160px; ">你可能对以下感兴趣：</h3>
                                                              <div class="lul" style="position:relative; top:80px;left:60px;">
                                                                <ul>
                                                                    <li>ppppppppppppppppp</li>
                                                                    <li>ppppppppppppppppp</li>
                                                                    <li>ppppppppppppppppp</li>
                                                                    <li>ppppppppppppppppp</li>
                                                                    <li>ppppppppppppppppp</li>
                                                                </ul>
                                                              </div>
                                                              <div class="lul" style="position:relative; left:400px;top:-36px;">
                                                                    <ul>
                                                                    <li>ppppppppppppppppp</li>
                                                                    <li>ppppppppppppppppp</li>
                                                                    <li>ppppppppppppppppp</li>
                                                                    <li>ppppppppppppppppp</li>
                                                                    <li>ppppppppppppppppp</li>
                                                                </ul>
                                                              </div>
                                                    </div>
                                </div>
                                <!-- --------------评论区--------------------->
                            
                        <div id="pl" style="position:relative;border-bottom:1px solid #F5F4F3;width:98%;float:left;margin-top:0px;margin-bottom:80px;">
                                             <?php
                                             if($articleInfo['comment'] == ""){
                                                echo "";
                                             }else{
                                             foreach($articleInfo['comment'] as $k=>$v){
                                              
                                               
                                             ?>
                                                <div class="h" id="1">
                                                     <div name="towcommentID" style="display:none;" id="<?php echo $v['comment_ID']; ?>"></div>
                                                     <div class="one1" style="position:relative; float:left;left:1px;">
                                                        <img width="60" height="60" src="<?php echo PUBLIC_URL ; ?>images/1.jpg" />
                                                    </div>
                                                     <div class="tow1" style="position:relative;left:100px;width:80%;">
                                                        <font style="position:absolute;left:1px;;top:10px; width:500px;text-align:left;color:#336598;"><?php echo $v['comment_author']; ?> <?php echo $v['comment_date']?> | </font><br>
                                                        <p style="position:relative;top:20px;left:1px;display:block;width:100%; height:50px;display:block;overflow:hidden;text-align:left;margin-bottom:30px;">
                                                               <?php echo $v['comment_content'];?>
                                                        </p>
                                                    </div>
                                                    <div class="three1" style="position:absolute;left:85%;top:10px;font-size:13px;width:100px;height:100px;text-align:right;">
                                                        <font id="<?php echo $v['comment_ID'];?>" name="delparent" style="color:pink;cursor:pointer;"><?php if($_SESSION['username'] == $v['comment_author']){ echo "X";}?></font>
                                                        <h3 style="position:absolute;font-size:20px;color:#A8C537;right:-10px;"><?php echo $k+1;  ?>#</h3>
                                                        
                     
                                                    </div>
                                                    <!-- 弹出区-->
                                                    <?php 
                                                        if($v['tow_comment'] == ""){
                                                            echo "";
                                                        }else{
                                                        foreach($v['tow_comment'] as $tow){ 
                                                    ?>
                                                    <div style="margin-left:100px;width:80%; height:50px;text-align:left;margin-top:10px; padding-top:5px;clear:both;margin-bottom:30px;"><img width=20 height=20 src="./img.jpg" />&nbsp;&nbsp;<font><?php echo $tow['comment_author']; ?>：</font><?php echo $tow['comment_content']; ?><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font style="margin-top:50px;"><?php echo $tow['comment_date'];?></font>&nbsp;&nbsp;&nbsp;<font style="cursor:pointer;" name="wwee"><a href="#one">回复</a></font><font name="deltowcomment" id="<?php echo $tow['comment_ID'];?>" style="margin-left:200px;cursor:pointer; color:pink;"><?php if($_SESSION['username'] == $tow['comment_author']){ echo "X";}?></font></div>
                                                    <?php } } ?>
                                                    <!-- 弹出区-->
                                                    <div  style="color:#336596;margin-top:0px;text-align:right;clear:both;">
                                                            <font name="wwee" style="cursor:pointer;">回复 ｜ </font>
                                                            <font>顶<font>[0]</font>｜ </font>
                                                            <font>楼顶-地下室</font>
                                                    </div>
                                                </div>
                                                <?php
                                                            
                                                            }
                                                            }
                                                ?>
                                      
                                        <!-- 社会评龙-->
                        </div>
                        <div class="p" style="clear:both;width:98%;padding:10px;background:#F9F9F9;height:300px;">
                                                      <input type="hidden" id="action" value="<?php echo DOCUMENT.'article/pubcomment'  ?>">
                                                            <input type="hidden" name="articleID" value="<?php echo $_GET['ID']; ?>">
                                                            <input type="hidden" name="comment_author" value="<?php echo $_SESSION['username']; ?>">
                                                            <input type="hidden" name="userID" value="<?php echo $_SESSION['userid']; ?>">
                                                            <input type="hidden" name="login_ip" value="<?php echo $_SESSION['loginip']; ?>">
                                                            <input type="hidden" name="user_email" value="<?php echo $_SESSION['useremail']; ?>">
                                                            <textarea name="comment" style="width:100%;height:200px; font-size:20px;text-indent:2em;" placeholder="我也说一句"></textarea>
                                                            <font onclick="checklogin()" style="position:relative;float:right;" size="2" color="#B2B2B2">【顶】,让你眼中精彩的评论亮起来<input  type="submit" value="发表评论"></font>
                        </div>
                                        
                                  
                                  
                                <!-- --------------评论区--------------------->
                             
                    </div><!--左边盒子 -->
                                        
                <!-- 便利区end -->
                        <!--测边栏(1)start -->
                        <?php  include_once(VIEWS_URL.'welcome/aside_one.php');  ?>
                        <!--测边栏(1)end -->
                       
                       <!-- 手机扫描start-->
                        <div style="float:right;position:relative; top:1350px; width:30%;">
                            <img  width="100%" src="<?php echo PUBLIC_URL ?>images/ao/ad-img02.jpg">
                            <!-- 手机扫描-->           
                                    
                                        <!-- 推荐咨询s-->
                             <div id="tuijian" style="left:-1px;position:relative; border-bottom:1px dashed gray;text-align:left;height:50px;margin-top:20px;">
                                                <img src="<?php echo PUBLIC_URL ?>images/ao/tuijian.bmp" >
                             </div>
                                        <div class="tj" style="margin-top:5px; width:98%;">
                                                <?php for($i=0; $i<4; $i++){ ?>
                                                    <div  class="tj-tj"style="width:100%; height:140px; border-bottom:1px dashed gray;word-break: break-all;word-wrap: break-word;text-align:left;line-height:20px; position:relative;overflow:hidden">
                                                        <h3>qqqqqqqqqqqqqqqqq</h3>
                                                        <p>
                                                        jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj22222222222222222222222222222222222222222222222wwwwwwwwwwwwwwwwwwwwwwwwwwwww
                                                        jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj22222222222222222222222222222222222222222222222wwwwwwwwwwwwwwwwwwwwwwwwwwwww
                                                        jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj22222222222222222222222222222222222222222222222wwwwwwwwwwwwwwwwwwwwwwwwwwwww
                                                        jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj22222222222222222222222222222222222222222222222wwwwwwwwwwwwwwwwwwwwwwwwwwwww
                                                        jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
                                                        </p><br>
                                                        <img  onclick="alert('更多多') "style="position:absolute;top:120px;left:90%;" src="<?php echo PUBLIC_URL ?>images/ao/more.bmp">
                                                    </div>
                                                <?php } ?>
                                        </div>           

                                          <!-- 推荐咨询e-->
                        </div>
                       
           <!-- </div>-->
            
        
        </div>
            <!-- 包括左右两个盒子end-->

</div>
<script>
    function hf(obj)
    {
        var parent=obj.parentNode.parentNode.parentNode;
        parent.style.height='260px';
        obj.parentNode.nextSibling.nextSibling.style.display='block';
       }
    
    function next(obj)
    {
        while(obj){
            if(obj.nextSibling.nodeName=="FORM"){
                return obj.nextSibling;
            }else{
                obj=obj.nextSibling;
            }
        }
    }
    
    function checklogin(){
        var content1 = $('textarea[name=comment]').val();
        var username = $('input[name=comment_author]').val();
        var userid = $('input[name=userID]').val();
       if( username == "" && userid == ""){
            alert('请您登录或者先去注册');
        }else if( content1 == ""){
            alert('评论内容不能空！！');
            exit;
        }else{
            var pubcontent = $('textarea[name=comment]').val();//此为刚刚发表的评论
            var username = $('input[name=comment_author]').val();
            var userid = $('input[name=userID]').val();
            var userip = $('input[name=login_ip]').val();
            var useremail = $('input[name=user_email]').val();
            var articleid = $('input[name=articleID]').val();
            
             $.ajax({
                    url:'<?php echo DOCUMENT."article/pubcomment" ?>',
                    data:'pubcontent='+pubcontent+'&username='+username+'&userid='+userid+'&userip='+userip+'&useremail='+useremail+'&articleid='+articleid,
                    type:'post',
                    success:function(data){
                        if(data['status'] = 1){
                            var pingdiv = $('<div class="h"><div class="one1" style="position:relative; float:left;left:1px;"><img width="60" height="60" src="<?php echo PUBLIC_URL ; ?>images/1.jpg" /></div><div class="tow1" style="position:relative;left:100px;width:80%;"><font style="position:absolute;left:1px;;top:10px; width:500px;text-align:left;color:#336598;"><?php echo $_SESSION['username']; ?> <?php echo date("Y-m-d H:i:s",time())?> | </font><br><p style="position:relative;top:20px;left:1px;display:block;width:100%; height:50px;display:block;overflow:hidden;text-align:left;margin-bottom:30px;">'+pubcontent+'</p></div><div class="three1" style="position:absolute;left:85%;top:10px;font-size:13px;width:100px;height:100px;text-align:right;"><h3 style="position:absolute;font-size:20px;color:#A8C537;right:-10px;">OK</h3></div><div  style="color:#336596;margin-top:0px;text-align:right;clear:both;"><font name="wwee" style="cursor:pointer;">回复 ｜ </font><font>顶<font>[0]</font>｜ </font><font>楼顶-地下室</font></div></div>');
                            var parentdiv = $('#pl');
                            parentdiv.append(pingdiv);
                        }
                    },
                    error:function(){
                        alert('ww');
                    },
                    dataType:'json'
                    })
           
        }
    }

    $('font[name=wwee]').live('click', function(){

        //$(this).parent().parent().find('div[name=rep]').css('display', 'block');
        var divv = $('<div name="rep" style="display:block;margin-top:10px;text-align:right;clear:both;"><form><input type="hidden" name="articleID" value="<?php echo $_GET['ID']; ?>"><input type="hidden" name="comment_author" value="<?php echo $_SESSION['username']; ?>"><input type="hidden" name="userID" value="<?php echo $_SESSION['userid']; ?>"><input type="hidden" name="login_ip" value="<?php echo $_SESSION['loginip']; ?>"><input type="hidden" name="user_email" value="<?php echo $_SESSION['useremail']; ?>"><input type="hidden" name="origincommentID" value="<?php echo $v['comment_ID']; ?>"><a name="one"><textarea name="tow_replay" style="width:72%;height:100px;font-size:20px;color:#B8CE45;margin-left:100px;float:left;" placeholder="我也说一句吧" ></textarea></a><br><input name="insertrow" style="color:gray;width:100px; height:30px; background:#F5F4F3;color:#B1C845;font-size:20px;text-align:center;cursor:pointer;float:right;margin-top:18px;margin-right:30px;" value="发表"></form></div>');
        $(this).parent().parent().append(divv);
    });
    
    $('input[name=insertrow]').live('click', function(){
        
        var username = $('input[name=comment_author]').val();
        var userid = $('input[name=userID]').val();
       if(username == "" && userid == ""){
            alert('请您登录或者先去注册');
        }else{
        var obj = $(this);
        var content = $(this).parent().find('textarea[name=tow_replay]').val();//二级回复内容
        var fathercommentID = $(this).parent().parent().parent().find('div[name=towcommentID]').attr('id');//父级评论ID
        var username = $('input[name=comment_author]').val();
        var userid = $('input[name=userID]').val();
        var userip = $('input[name=login_ip]').val();
        var useremail = $('input[name=user_email]').val();
        var articleid = $('input[name=articleID]').val();
        $.ajax({
            url:'<?php echo DOCUMENT."article/towcomment"; ?>',
            data:'content='+content+'&fathercommentID='+fathercommentID+'&username='+username+'&userid='+userid+'&userip='+userip+'&useremail='+useremail+'&articleid='+articleid,
            type:'post',
            success:function(data){

                if(data['status'] == 1){
                    var gg = obj.parent().parent();
                    gg.css('display', 'none');
                    var row = $('<div style="margin-left:100px;width:80%; height:50px;text-align:left;margin-top:10px; padding-top:5px;clear:both;margin-bottom:30px;"><img width=20 height=20 src="./img.jpg" />&nbsp;&nbsp;<font><?php echo $_SESSION["username"]; ?>：</font>'+content+'<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font style="margin-top:50px;"><?php echo date('Y-m-d',time())?></font>&nbsp;&nbsp;&nbsp;<font style="cursor:pointer;" name="wwee">回复</font></div>');
                    gg.after(row);
                    
                }
            },
            error:function(){
                alert('失败');
            },
            dataType:'json'
        });
        
        
        }
    });
    
    $('font[name=deltowcomment]').live('click', function(){
        var commentID = $(this).attr('id');
        var obj = $(this);

        $.ajax({
            
            url:'<?php echo DOCUMENT."article/deltowcomment"; ?>',
            data:'delID='+commentID,
            type:'get',
            success:function(data){
                if(data['status'] == 1){
                    obj.parent().css('display', 'none');
                    
                }
            },
            error:function(){
                alert('失败');
            },
            dataType:'json'
        });
    });
    
    $('font[name=delparent]').live('click', function(){
        if(confirm('你确定要删除这条评论吗？')){
            var obj = $(this);
            var parentID = $(this).attr('id');
            $.ajax({
                
                url:'<?php echo DOCUMENT."article/delparentcomment"; ?>',
                data:'delID='+parentID,
                type:'get',
                success:function(data){
                    
                    obj.parent().parent().animate({
                       height: 'toggle', opacity: 'toggle'
                     }, "slow");
                },
                
                error:function(){
                    alert('失败');
                },
                dataType:'json'
            });
        
        }else{
            alert('ww');
        }
    
    });

</script>

    